﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IT_RoadBlock.Dto
{
    public enum StatusEnum
    {
        Success,Fail
    }


    public class Result
    {
        public StatusEnum StatusEnum { get; set; }
        public object Value { get; set; }
        public string Message { get; set; }
    }


    public class ResultFactory
    {
        public static Result Ok(string message= "操作成功", object value=null)
        {
            return new Result() { StatusEnum = StatusEnum.Success, Value = value, Message = message };
        }

        public static Result Fail(string message = "操作失败", object value = null)
        {
            return new Result() { StatusEnum = StatusEnum.Fail, Value = value, Message = message };
        }
    }
}
